package framework.model;

import com.alibaba.fastjson.JSON;

/**
 * Created by chencs on 2017/4/11.
 */
public class ResponseOptUtil {
    public static final String RET_SUCESS_TYPE = "0";
    public static final String RET_FAIL_TYPE = "1";
    public static final String RET_FAIL_MSG = "系统内部错误";
    public static final String RET_DATA_REPEAT = "数据重复";

    public static String commomError() {
        return JSON.toJSONString(new ResponseOptCommon(RET_FAIL_TYPE, RET_FAIL_MSG));
    }

    public static String commonMsgError(String msg) {
        return JSON.toJSONString(new ResponseOptCommon(RET_FAIL_TYPE, msg));
    }

    public static String commonTypeMsgError(String type, String msg) {
        return JSON.toJSONString(new ResponseOptCommon(type, msg));
    }

    public static String commonSucess() {
        return JSON.toJSONString(new ResponseOptCommon(RET_SUCESS_TYPE, null));
    }
}
